import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/i18n',
    name: 'i18n',
    component: () => import('../views/i18n-example.vue')
  },
  {
    path: '/components',
    children: [
      {
        path: 'descriptions',
        name: 'descriptions',
        component: () => import('../views/Descriptions.vue')
      },
      {
        path: 'form',
        name: 'form',
        component: () => import('../views/Form.vue')
      },
      {
        path: 'e-search-form',
        name: 'e-search-form',
        component: () => import('../views/ESearchForm.vue')
      },
      {
        path: 'table',
        name: 'table',
        component: () => import('../views/Table.vue')
      },
      {
        path: 'cropper',
        name: 'cropper',
        component: () => import('../views/Cropper.vue')
      },
      {
        path: 'dict-tag',
        name: 'dict-tag',
        component: () => import('../views/DictTag.vue')
      },
      {
        path: 'editor',
        name: 'editor',
        component: () => import('../views/Editor.vue')
      },
      {
        path: 'button',
        name: 'button',
        component: () => import('../views/Button.vue')
      },
      {
        path: 'icon',
        name: 'icon',
        component: () => import('../views/Icon.vue')
      },
      {
        path: 'card-title',
        name: 'card-title',
        component: () => import('../views/CardTitle.vue')
      },
      {
        path: 'search',
        name: 'search',
        component: () => import('../views/Search.vue')
      },
      {
        path: 'esearch-form',
        name: 'esearch-form',
        component: () => import('../views/ESearchForm.vue')
      },
      {
        path: 'input-password',
        name: 'input-password',
        component: () => import('../views/InputPassword.vue')
      },
      {
        path: 'pagination',
        name: 'pagination',
        component: () => import('../views/Pagination.vue')
      },
    
      {
        path: 'upload-file',
        name: 'upload-file',
        component: () => import('../views/UploadFile.vue')
      },
      {
        path: 'summary-card',
        name: 'summary-card',
        component: () => import('../views/SummaryCard.vue')
      },
      {
        path: 'image-viewer',
        name: 'image-viewer',
        component: () => import('../views/ImageViewer.vue')
      },
      {
        path: 'dynamic-component',
        name: 'dynamic-component',
        component: () => import('../views/DynamicComponent.vue')
      },
      {
        path: 'router-search',
        name: 'router-search',
        component: () => import('../views/RouterSearch.vue')
      },
      {
        path: 'echart',
        name: 'echart',
        component: () => import('../views/EChart.vue')
      },
      {
        path: 'diy-editor',
        name: 'diy-editor',
        component: () => import('../views/DiyEditor.vue')
      },
      {
        path: 'doc-alert',
        name: 'doc-alert',
        component: () => import('../views/DocAlert.vue')
      }
    ]
  },
  {
    path: '/interaction',
    children: [
      {
        path: 'dialog',
        name: 'dialog',
        component: () => import('../views/Dialog.vue')
      },
      {
        path: 'econfirm-dialog',
        name: 'econfirm-dialog',
        component: () => import('../views/EConfirmDialog.vue')
      },
      {
        path: 'error',
        name: 'error',
        component: () => import('../views/Error.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router 